package com.zhen.aikan.service.impl;

import com.zhen.aikan.service.IGitHubService;
import com.zhen.aikan.util.GitHubFileUtil;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author LiJiaZhen
 * @date 2023/11/9 15:23
 */
@Service
public class GitHubServiceImpl implements IGitHubService {
    @Override
    public String upload(MultipartFile multipartFile, String message) {
        String url;
        try {
            url = GitHubFileUtil.uploading(multipartFile, message);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return url;
    }
}
